package com.mapper;

import com.domain.Admin;
import org.apache.ibatis.annotations.*;

@Mapper
public interface AdminMapper {

    @Select("SELECT * FROM t_admin WHERE id = #{id}")
    Admin findById(Integer id);

    @Insert("INSERT INTO t_admin (admin_name, pwd, phone)" +
            "values (#{adminName}, #{pwd}, #{phone})")
    int insertAdmin(Admin admin);

//    @Update("")
//    int updateAdmin(Admin admin);

    @Delete("DELETE FROM t_admin WHERE id = #{id}")
    int deleteAdmin(Integer id);

    @Select("SELECT * FROM t_admin WHERE admin_name = #{adminName} and pwd = #{pwd}")
    Admin adminLogin(Admin admin);

}
